#define  M 4
#define  N 5
#include  "stdio.h"
int fun( int  a[M][N] )
{   /**********Program**********/
int i,sum=0;
for(i=0;i<N;i++)
sum+=a[0][i]+a[M-1][i];
for(i=1;i<M-1;i++)
sum+=a[i][0]+a[i][M-1];

return sum;
/**********  End  **********/
}

void main()
{ int y;
int a[M][N]={{1,3,5,7,9},{2,4,6,8,10},{2,3,4,5,6},{4,5,6,7,8}};
y = fun( a ) ;
printf( "s=%d\n", y) ;
}
